package com.yue.design.builder;

/**
 * 创建者模式，创建的对象内容不分前后，
 */
public class SchoolBuilder {
    private School school;
    public SchoolBuilder addTeacher(String name){
             school.setTeacher(name);
             return this;
    }
    public SchoolBuilder addStudent(String name){
        school.setStudent(name);
        return this;
    }

    public School builder(){
       return school = new School();
    }
}
